function js_yes(e){
    var id = $(e).context['dataset']['id'];
    mui.post('/setcollect', {
            type:1,
            domainId:id,
        },function(data){
            if(data.code!=200){
                mui.toast(data.message);
            }else{
                console.log(data.code);
                console.log(data.message);
                $(e).val("已关注");
                $(e).attr("style","background: #e5e5e5;padding: 6px 5px;");
                $(e).data("cid",data.message);
                $(e).attr("onclick","js_del(this)");
                mui.toast('关注成功');
            }
        },'json'
    );
}

function js_del(e){
    var id = $(e).context['dataset']['id'];
    var cid = $(e).data("cid");
    mui.post('/delcollect', {
            collectionIds:id,
        },function(data){
            if(data.code!=200){
                mui.toast(data.message);
            }else{
                $(e).val("关注");
                $(e).attr("style"," ");
                $(e).attr("onclick","js_yes(this)");
                mui.toast('取消关注');
            }
        },'json'
    );
}